--欲承其重
local yuchengqizhon = fk.CreateSkill {
    name = "mcdh_yuchengqizhon"
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

yuchengqizhon:addEffect(fk.DamageInflicted,{
    can_trigger = function(self,event,target,player,data)
        return player:hasSkill(self) and target == player and player:getHandcardNum() > player.hp
    end,
    on_cost = function(self,event,target,player,data)
        local room = player.room
        local card =  room:askForDiscard(player, data.damage, data.damage, true, self.name, true, ".", "#yuchengqizhon-discard")
        if #card >0 then
            return true
        end
    end,
    on_use = function(self,event,target,player,data)
        return true
    end
})

Fk:loadTranslationTable {
    ["mcdh_yuchengqizhon"] = "欲承其重",
    [":mcdh_yuchengqizhon"] = "当你受到伤害时，若你的手牌数大于体力值，你可以弃置数量等同于此次伤害值张牌，防止此伤害。",
    ["#yuchengqizhon-discard"] = "欲承其重:弃置数量等同于此次伤害值张牌，防止此伤害。"
}

return yuchengqizhon